home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / cmdpost7.arc / CP_INST.SFX / lha / CMDPOST.CPM < prev    next >
Text File  |  1990-07-16  |  22KB  |  592 lines

  1. ; Define addon menu   USER menus should go into CMDUSER.CPM...by convention...
  2. #NextFile CMDUSER.CPM
  3.  
  4.  
  5.  
  6. ; CmdPost menu      initialization code
  7.  
  8.     ; Initialize a few variables here.  You may dink the CP names below
  9.     ; Just keep the two names different.
  10.       
  11.     a=Version()
  12.         CP="CmdPost"
  13.         ; Lines below good only for licensed versions.
  14.     TitleFirst="Command Post - %a%"   ; Name of your primary CP Window
  15.     TitleRest= "Command Post # %a%"   ; Name of your other CP Windows
  16.         b=strsub(";",1,IsLicensed())
  17.         execute %b% TitleFirst="Command Post %a% - Eval Only"
  18.         execute %b% TitleRest ="Command Post %a% # Eval Only"
  19.     crlf=strcat(num2char(13),num2char(10))
  20.     tab=num2char(9)
  21.  
  22. ; Knock out MS-DOS Executive
  23.         ErrorMode(@OFF)
  24.         WinHide("MS-DOS")
  25.         ErrorMode(@CANCEL)
  26.  
  27. ; Setting up the View menu item here.
  28.  
  29.         ViewShortLong=iniread(CP,"ViewShortLong","SHORT")
  30.  
  31.         MenuChange("ViewShort", (ViewShortLong=="SHORT")*@CHECK)
  32.         MenuChange("ViewLong",  (ViewShortLong=="LONG")*@CHECK)
  33.         
  34.         ViewBy=iniread(CP,"ViewBy","NAME")
  35.         MenuChange("ViewByName", (ViewBy=="NAME")*@CHECK)
  36.         MenuChange("ViewByDate", (ViewBy=="DATE")*@CHECK)
  37.         MenuChange("ViewBySize", (ViewBy=="SIZE")*@CHECK)
  38.         MenuChange("ViewByKind", (ViewBy=="KIND")*@CHECK)
  39.         MenuChange("ViewUnsorted",(ViewBy=="UNSORTED")*@CHECK)
  40.  
  41.         ViewWhat=iniread(CP,"ViewWhat","ALL")
  42.         MenuChange("ViewAll",      (ViewWhat=="ALL")     *@CHECK)
  43.         MenuChange("ViewPartial",  (ViewWhat=="PARTIAL") *@CHECK)
  44.         MenuChange("ViewPrograms", (ViewWhat=="PROGRAMS")*@CHECK)
  45.  
  46.         a=iniread(CP,"Partial","*.*")
  47.         SD3=strcat(strsub("*.*",1,IsMenuChecked("ViewAll")*3),strsub(a,1,IsMenuChecked("ViewPartial")*strlen(a)),strsub("*.EXE *.COM *.BAT *.PIF",1,IsMenuChecked("ViewPrograms")*23))
  48.         SetDisplay(ViewShortLong,ViewBy,SD3)
  49.         drop(a,ViewShortLong,ViewBy,ViewWhat,SD3)
  50.  
  51. ; Setup Print menu item...Kill it if no text printer
  52.         MenuChange("FilePrint", (IniRead(CP,"TextPrinter","")=="NONE") *@DISABLE)
  53. ; Setup Screen Blank Time.  Get time from win.ini
  54.         
  55.         run("cp_blnk.exe",iniread(CP,"BlankTime",5))
  56.                              ;    <0....blanking with no clock
  57.                              ;     0... no blanking, but have a clock
  58.                              ;    >0... blanking and clock
  59.                              ;    multiple startups ignored.
  60.  
  61.     ; This obscure code just names the two Command Post windows.
  62.     ; This code also is depended upon by the Main.CommandPost item below
  63.         IfOnlyMe=strsub(";",1,IsRunning()==@TRUE) ;Funny reverse logic...
  64.  
  65.         a=1                   ;dummy value
  66.         ErrorMode(@OFF)
  67.         Execute %IfOnlyMe%    WinTitle("",TitleFirst);Title of first 'Post
  68.         Execute %IfOnlyMe%    a="0,0,1000,@ABOVEICONS"
  69.         Execute %IfOnlyMe%    a=IniRead(CP,"WinPosition",a)
  70.         Execute %IfOnlyMe%    WinPlace(%a%,"")
  71.         Execute %IfOnlyMe%    Exit
  72.  
  73.     TitleTemp=TitleRest
  74.         a=WinExist(TitleFirst)
  75.     a=strsub(";",1,a)
  76.     Execute %a% TitleTemp=TitleFirst
  77.     WinTitle("",TitleTemp);Title of this 'Post
  78.     WinPlace(500,0,1000,@ABOVEICONS,TitleRest)
  79.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  80.         ErrorMode(@CANCEL)
  81.     ;Do not Drop TitleFirst,TitleRest,crlf,tab,CP as these are used
  82.     ;in following menu items.
  83.  
  84.     Drop(a,TitleTemp,IfOnlyMe)
  85.  
  86. ; And the menu starts.  Notice that we are emulating the MS-DOS Window
  87. &File
  88.  &Run...
  89.         r=CurrentFile()
  90.         a=strsub(";",1,IsKeyDown(@SHIFT))
  91.         execute %a% r=askline("RUN","Enter file to run",r)
  92.         r=strcat(strtrim(r)," ")
  93.         i=strindex(r," ",0,@FWDSCAN)
  94.         run(strsub(r,1,i-1),strtrim(strsub(r,i,strlen(r)-i+1)))
  95.         drop(a,r,i)        
  96.  &Load...
  97.         r=CurrentFile()
  98.         a=strsub(";",1,IsKeyDown(@SHIFT))
  99.         execute %a% l=askline("LOAD","Enter file to load",CurrentFile())
  100.         l=strcat(strtrim(l)," ")
  101.         i=strindex(l," ",0,@FWDSCAN)
  102.         runicon(strsub(l,1,i-1),strtrim(strsub(l,i,strlen(l)-i+1)))
  103.         drop(a,i,l)
  104.  Bro&wse...
  105.         l=CurrentFile()
  106.         a=strsub(";",1,IsKeyDown(@SHIFT))
  107.         execute %a% l=askline("Browse","Enter file to browse",l)
  108.         run("browser.exe",l)
  109.         drop(a,l)
  110.  &Notepad Edit...
  111.         l=CurrentFile()
  112.         a=strsub(";",1,IsKeyDown(@SHIFT))
  113.         execute %a% l=askline("Notepad Edit","Enter file to edit",l)
  114.         run("notepad.exe",l)
  115.         drop(a,l)
  116.  &Copy...
  117.         r=OtherDir()
  118.         a=strsub(";",1,IsKeyDown(@SHIFT))
  119.         s=strcat(DirItemize("")," ",FileItemize(""))
  120.         terminate(strlen(s)==1,"Copy Error","No files selected")
  121.         execute %a% r=askline("Copy",StrCat(s,crlf,crlf,"to"),r)
  122.         terminate(r=="","Copy Error","Cannot copy to null file name")        
  123.         FileCopy(s,r,@TRUE)
  124.         OtherUpdate()
  125.         q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
  126.         q=strsub(";",1,q!=0)
  127.         execute %q% SetDisplay("","","") 
  128.         drop(a,r,s,q)
  129.  &Move/Rename...
  130.         r=OtherDir()
  131.         a=strsub(";",1,IsKeyDown(@SHIFT))
  132.         s=strcat(DirItemize("")," ",FileItemize(""))
  133.         terminate(strlen(s)==1,"Move Error","No files selected")
  134.         execute %a% r=askline("Move",StrCat(s,crlf,crlf,"to"),r)
  135.         terminate(r=="","Move Error","Cannot move to null file name")
  136.         FileMove(s,r,@TRUE)
  137.         SetDisplay("","","")
  138.         OtherUpdate()
  139.         drop(a,r,s)
  140.  &Delete File..
  141.         f=FileItemize("")
  142.         g=DirItemize("")
  143.         c=strsub( ";", 1, (strlen(g)==0) )
  144.         b=0
  145.         execute %c% b=AskYesNo("!!! Warning !!! ",strcat("Delete files from these directories too?",crlf,g))
  146.         c=strsub(";",1,abs(b-1))
  147.         execute %c% f=strcat(g," ",f)
  148.         terminate(strlen(f)==0,"delete","No files specified")
  149.         terminate(askyesno("Delete",f)==0,"Delete","File(s) not deleted")
  150.         FileDelete(f)
  151.         SetDisplay("","","")
  152.         OtherUpdate()  ; Well if the "other" CmdPost Window points to the
  153.                     ; same directory, it *IS* nice...
  154.         drop(f,g,a)
  155.  
  156.  &Print...
  157.         s=FileItemize("")
  158.         terminate(strlen(s)==0,"Print Error","No files selected")
  159.         TextPrinter=iniread(CP,"TextPrinter","ASK")
  160.         a=strsub(";",1,TextPrinter!="ASK")
  161.         b=";"
  162.         Execute %a% r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",crlf,"Do you have a standard (NON-Postscript) printer?"))
  163.         Execute %a% b=strsub(";",1,r==@YES)
  164.         Execute %b% iniwrite(CP,"TextPrinter","NONE")
  165.         Execute %b% MenuChange("FilePrint",@DISABLE)
  166.         Execute %b% Exit
  167.         Execute %a% TextPrinter="NONE|LPT1|LPT2|LPT3"
  168.         Execute %a% TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
  169.         Execute %a% terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
  170.         Execute %a% iniwrite(CP,"TextPrinter",TextPrinter)
  171.         Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
  172.         a=AskLine("Print",strcat(s,crlf,crlf,"to"),TextPrinter)
  173.         FileCopy(s,a,@FALSE)
  174.  
  175.  _&Size of selected files
  176.         message("Total size of files",strcat(FileSize(FileItemize(""))," Bytes"))
  177.  
  178.  &Freespace on Drives   
  179. ;        This code initially asks for your last drive
  180. ;        (It does assume you have no holes between C and the
  181. ;         last drive...)
  182. ;        and then computes disk space based on the last drive
  183.  
  184.         NextDrive="C"
  185.         crlf=strcat(num2char(13),num2char(10))
  186.         LastDrive=iniread("CmdPost","LastDrive","ASK") 
  187.         xxx=strsub(";",1,(LastDrive!="ASK"))
  188.         execute %xxx% LastDrive=AskLine("Setup Question",strcat("Enter letter of last (contiguous) disk drive",crlf,"C D E F G H ...Z"),"C")
  189.         execute %xxx% LastDrive=StrUpper(LastDrive)
  190.         execute %xxx% iniwrite("CmdPost","LastDrive",LastDrive)
  191.         
  192.         ; Always do C drive
  193.         a=DiskFree(NextDrive)/1024
  194.         TotalSize=a
  195.         DriveReport=strcat(NextDrive," = ",a,"K")
  196.         NextDrive=num2char(char2num(NextDrive)+1)
  197.         xxx=strsub(";",1,NextDrive>LastDrive)
  198.  
  199.         ; Check on D drive
  200.         execute %xxx% a=DiskFree(NextDrive)/1024
  201.         execute %xxx% TotalSize=TotalSize+a
  202.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  203.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  204.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  205.  
  206.  
  207.         ; Check on E drive
  208.         execute %xxx% a=DiskFree(NextDrive)/1024
  209.         execute %xxx% TotalSize=TotalSize+a
  210.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  211.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  212.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  213.  
  214.  
  215.         ; Check on F drive
  216.         execute %xxx% a=DiskFree(NextDrive)/1024
  217.         execute %xxx% TotalSize=TotalSize+a
  218.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  219.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  220.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  221.  
  222.  
  223.         ; Check on G drive
  224.         execute %xxx% a=DiskFree(NextDrive)/1024
  225.         execute %xxx% TotalSize=TotalSize+a
  226.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  227.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  228.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  229.  
  230.  
  231.         ; Check on H drive
  232.         execute %xxx% a=DiskFree(NextDrive)/1024
  233.         execute %xxx% TotalSize=TotalSize+a
  234.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  235.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  236.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  237.  
  238.  
  239.         ; Check on I drive
  240.         execute %xxx% a=DiskFree(NextDrive)/1024
  241.         execute %xxx% TotalSize=TotalSize+a
  242.         execute %xxx% DriveReport=strcat(DriveReport,crlf,NextDrive," = ",a,"K")
  243.         execute %xxx% NextDrive=num2char(char2num(NextDrive)+1)
  244.         execute %xxx% xxx=strsub(";",1,NextDrive>LastDrive)
  245.  
  246.         ; Well if you have more than I drives, just repeat the
  247.         ; Code blocks above
  248.  
  249.         Message("Total Space = %TotalSize%K",DriveReport)
  250.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  251.  
  252.  Space on &A and size of files
  253.         message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
  254.  
  255.  
  256.  Space on &B and size of files
  257.         message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
  258.  
  259.  
  260.  _&Extensions...
  261.         a=strtrim(CurrentFile())
  262.         i=strindex(a,".",0,@FWDSCAN)
  263.         terminate(i==0,"Association Error","Associated files must have an extension")
  264.         b=strsub(a,i+1,strlen(a)-i)
  265.         c=iniread("extensions",b,"???.EXE ^.%b%")
  266.         d=askline("Associate","%b% files are associated with",c)
  267.         terminate(c==d,"","")
  268.         iniwrite("extensions",b,d)
  269.  _E&xit Windows
  270.         EndSession()
  271.         
  272. &Dir
  273.  C&reate Directory...
  274.         a=askline("Create Directory","Enter directory to create","")
  275.         terminate(a=="","Create Error","Cannot create directory with null name")
  276.         DirMake(a)
  277.         SetDisplay("","","")
  278.         drop(a)
  279.  
  280.  &Delete Directory...
  281.         f=DirItemize("")
  282.         terminate(strlen(f)==0,"Delete Directory","No directory specified")
  283.         terminate(@no==askyesno("Delete Directory",f),"Delete Directory","Directory not deleted")
  284.         DirRemove(f)
  285.         SetDisplay("","","")
  286.         OtherUpdate()   ; Well if the "other" CmdPost Window points to the
  287.                       ; same directory, it *is* nice
  288.         drop(f)
  289.  
  290.  &Change Directory...
  291.         a=DirGet()
  292.         b=strindex(a,':',1,@fwdscan)
  293.         c=askline("Change Directory","Enter directory name",strsub(a,b+1,strlen(a)-b-1))
  294.         terminate(c=="","Directory Error","Directory with null name does not exist")
  295.         DirChange(c)
  296.         SetDisplay("","","")
  297.         drop(a,b,c)
  298.  
  299.  _&Format Diskette...
  300.         ; A wonderful example of variable substitution
  301.         D1="1) 5.25 High Density (1.2M)"
  302.         D2="2) 5.25 Standard (360K)"
  303.         D3="3) 3.5  High Density (1.44M)"
  304.         D4="4) 3.5  Standard (720K)"
  305.         D0="0) None"
  306.         DC="%D1%|%D2%|%D3%|%D4%|%D0%"
  307.         DriveA=iniread(CP,"DriveA","ASK")
  308.         xxx=strsub(";",1,DriveA!="ASK")
  309.         execute %xxx% Message("Attention","Command Post needs to learn what kind of floppies %crlf% the system has.  Please select accordingly.")
  310.         execute %xxx% a=ItemSelect("Select type of Drive A",DC,"|")
  311.         execute %xxx% Terminate(a=="","You MUST select an option for A.","Please retry FORMAT command.")
  312.         execute %xxx% DriveA=strsub(a,1,1)
  313.         execute %xxx% iniwrite(CP,"DriveA",DriveA)
  314.         DriveB=iniread(CP,"DriveB","ASK")
  315.         xxx=strsub(";",1,DriveB!="ASK")
  316.         execute %xxx% a=ItemSelect("Select type of Drive B",DC,"|")
  317.         execute %xxx% Terminate(a=="","You MUST select an option for B.","Please retry FORMAT command.")
  318.         execute %xxx% DriveB=strsub(a,1,1)
  319.         execute %xxx% iniwrite(CP,"DriveB",DriveB)
  320.        
  321.         A0=""
  322.         A1="1)    A:   5.25 HD (1.2M)|2)    A:   5.25 DD (360K)"
  323.         A2="2)    A:   5.25 DD (360K)"
  324.         A3="3)    A:   3.5 HD (1.44M)|4)    A:   3.5 Std (720K)"
  325.         A4="4)    A:   3.5 Standard (720K)"
  326.         B0=""
  327.         B1="5)    B:   5.25 HD (1.2M)|6)    B:   5.25 DD (360K)"
  328.         B2="6)    B:   5.25 Standard (360K)"
  329.         B3="7)    B:   3.5 HD (1.44M)|8)    B:   3.5 DD (720K)"
  330.         B4="8)    B:   3.5 DD (720K)"
  331.         FF=strcat(A%DriveA%,"|",B%DriveB%)
  332.         drop(A0,A1,A2,A3,A4,B0,B1,B2,B3,B4)
  333.  
  334.         FF=ItemSelect("Choose Format Type Desired",FF,"|")
  335.         terminate(FF=="","Format","No parameters selected")
  336.  
  337.         FF=strsub(FF,1,1)   ; FF will be 1 thru 8 (with luck)
  338.         DR=strsub("AB",(FF>4)+1,1)  ; DR is desired drive
  339.         FF=FF-((FF>4)*4)            ; FF is 1 thru 4
  340.         F11=""
  341.         F12="/4"
  342.         F22=""
  343.         F33=""
  344.         F34="/n:9 /t:80"
  345.         F44=""
  346.         DC=Drive%DR%   ; get drive type
  347.         FC=F%DC%%FF%
  348.         FC="%DR%:  %FC%"
  349.         DC=strsub(D%FF%,4,strlen(d%FF%)-3)
  350.         Pause("Attention",strcat("Preparing to format %DC%",crlf,"diskette in Drive %DR% with command:",crlf,"FORMAT %FC%"))
  351.         run("command.com","/c format.com %FC%")
  352.         drop(D0,D1,D2,D3,D4,DC,xxx,DriveA,DriveB)
  353.         drop(FF,DR,F11,F12,F22,F33,F34,F44,DC,FC)
  354.  
  355.  _Directory &Tree
  356.         run("cp_tree.exe","")
  357.  
  358.  
  359.  
  360. &View
  361.  &Short
  362.         SetDisplay("SHORT","","")
  363.         MenuChange("ViewShort",@CHECK)
  364.         MenuChange("ViewLong",@UNCHECK)
  365.         iniwrite(CP,"ViewShortLong","SHORT")
  366.  &Long
  367.         SetDisplay("LONG","","")
  368.         MenuChange("ViewShort",@UNCHECK)
  369.         MenuChange("ViewLong",@CHECK)
  370.         iniwrite(CP,"ViewShortLong","LONG")
  371.  _&All
  372.         SetDisplay("","","*.*")
  373.         MenuChange("ViewAll",@CHECK)
  374.         MenuChange("ViewPartial",@UNCHECK)
  375.         MenuChange("ViewPrograms",@UNCHECK)
  376.         iniwrite(CP,"ViewWhat","ALL")
  377.  &Partial...
  378.         a=iniread(CP,"Partial","*.*")
  379.         a=AskLine("View Partial","Enter types of files desired",a)
  380.         iniwrite(CP,"Partial",a)
  381.         SetDisplay("","",a)
  382.         MenuChange("ViewAll",@UNCHECK)
  383.         MenuChange("ViewPartial",@CHECK)
  384.         MenuChange("ViewPrograms",@UNCHECK)
  385.         iniwrite(CP,"ViewWhat","PARTIAL")
  386.  P&rograms
  387.         SetDisplay("","","*.EXE *.COM *.BAT *.PIF")
  388.         MenuChange("ViewAll",@UNCHECK)
  389.         MenuChange("ViewPartial",@UNCHECK)
  390.         MenuChange("ViewPrograms",@CHECK)
  391.         iniwrite(CP,"ViewWhat","PROGRAMS")
  392.  _By &Name
  393.         SetDisplay("","NAME","")
  394.         MenuChange("ViewByName",@CHECK)
  395.         MenuChange("ViewByDate",@UNCHECK)
  396.         MenuChange("ViewBySize",@UNCHECK)
  397.         MenuChange("ViewByKind",@UNCHECK)
  398.         MenuChange("ViewUnsorted",@UNCHECK)
  399.         iniwrite(CP,"ViewBy","NAME")
  400.  By &Date
  401.         SetDisplay("","DATE","")
  402.         MenuChange("ViewByName",@UNCHECK)
  403.         MenuChange("ViewByDate",@CHECK)
  404.         MenuChange("ViewBySize",@UNCHECK)
  405.         MenuChange("ViewByKind",@UNCHECK)
  406.         MenuChange("ViewUnsorted",@UNCHECK)
  407.         iniwrite(CP,"ViewBy","DATE")
  408.  By Si&ze
  409.         SetDisplay("","SIZE","")
  410.         MenuChange("ViewByName",@UNCHECK)
  411.         MenuChange("ViewByDate",@UNCHECK)
  412.         MenuChange("ViewBySize",@CHECK)
  413.         MenuChange("ViewByKind",@UNCHECK)
  414.         MenuChange("ViewUnsorted",@UNCHECK)
  415.         iniwrite(CP,"ViewBy","SIZE")
  416.  By &Kind       
  417.         SetDisplay("","KIND","")
  418.         MenuChange("ViewByName",@UNCHECK)
  419.         MenuChange("ViewByDate",@UNCHECK)
  420.         MenuChange("ViewBySize",@UNCHECK)
  421.         MenuChange("ViewByKind",@CHECK)
  422.         MenuChange("ViewUnsorted",@UNCHECK)
  423.         iniwrite(CP,"ViewBy","KIND")
  424.  &Unsorted
  425.         SetDisplay("","UNSORTED","")
  426.         MenuChange("ViewByName",@UNCHECK)
  427.         MenuChange("ViewByDate",@UNCHECK)
  428.         MenuChange("ViewBySize",@UNCHECK)
  429.         MenuChange("ViewByKind",@UNCHECK)
  430.         MenuChange("ViewUnsorted",@CHECK)
  431.         iniwrite(CP,"ViewBy","UNSORTED")
  432.  
  433.  |&1 Stack
  434.         winarrange(1)
  435.  &2 Arrange
  436.         winarrange(2)
  437.  &3 Arrange in Rows
  438.         winarrange(3)
  439.  &4 Arrange in Columns
  440.         winarrange(4)
  441.  _&5 (w/o CP) Stack
  442.         winiconize("")
  443.         winarrange(1)
  444.  &6 (w/o CP) Arrange
  445.         winiconize("")
  446.         winarrange(2)
  447.  &7 (w/o CP) Arrange in Rows
  448.         winiconize("")
  449.         winarrange(3)
  450.  &8 (w/o CP) Arrange in Cols
  451.         winiconize("")
  452.         winarrange(4)
  453.  
  454. &Main
  455.  &Command Post
  456.     ErrorMode(@OFF)
  457.     a=WinActivate(TitleFirst)
  458.     b=WinActivate(TitleRest)
  459.     ErrorMode(@CANCEL)
  460.     c=strsub(";",1, a&b )
  461.     Execute %c% run("cmdpost.exe","")
  462.     Execute %c% Exit
  463.     WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  464.     WinPlace(500,0,1000,@ABOVEICONS,TitleRest)
  465.         drop(a,b,c)
  466.  
  467.  
  468.  Control &Panel
  469.         errormode(@off)
  470.         terminate(winactivate("Control Panel","","")
  471.         errormode(@cancel)
  472.         run("control.exe","")
  473.  
  474.  C&lipboard
  475.         errormode(@off)
  476.         terminate(winactivate("Clipboard"),"","") ;Already Running
  477.         errormode(@cancel)
  478.         run("Clipbrd.exe","")
  479.  
  480.  &DOS Prompt
  481.         run("command.com","")
  482.  
  483.  _Get &Help Cardfile
  484.            run("cardfile.exe","cp_help.crd")
  485.  
  486.  Reset &Options...
  487.         a=iniread(CP,"BlankTime",5)
  488.         b1="Enter screen blanker delay time"
  489.         b2="or 0 to disable blanker"
  490.         b3="or negative time to disable clock"
  491.         b1=strcat(b1,crlf,b2,crlf,b3)
  492.         a=AskLine("Screen Blanker",b1,iniread(CP,"BlankTime",5))
  493.         iniwrite(CP,"BlankTime",a)
  494.         ErrorMode(@OFF)
  495.         WinClose("CmdPost Clock")
  496.         ErrorMode(@CANCEL)
  497.         run("CP_BLNK.EXE",a)
  498.         b1="Do you wish to save the current CmdPost"
  499.         b2="window position for future startups?"
  500.         b1=strcat(b1,crlf,b2)
  501.         a=AskYesNo("CmdPost Window Position",b1)
  502.         a=strsub(";",1,a==@NO)
  503.         execute %a% b1=WinPosition("")
  504.         execute %a% IniWrite(CP,"WinPosition",b1)
  505.         b1="Do you wish to reset CmdPost's Printer"
  506.         b2="and Disk Drive information?"
  507.         b1=strcat(b1,crlf,b2)
  508.         a=AskYesNo("Information Reset",b1)
  509.         a=strsub(";",1,a==@NO)
  510.         execute %a% iniwrite(CP,"TextPrinter","ASK")
  511.         execute %a% iniwrite(CP,"LastDrive","ASK")
  512.         execute %a% iniwrite(CP,"DriveA","ASK")
  513.         execute %a% iniwrite(CP,"DriveB","ASK")
  514.         execute %a% MenuChange("FilePrint",@ENABLE)
  515.         b1="CmdPost's saved information reset."
  516.         b2="You will be prompted to re-enter the"
  517.         b3="necessary information when it is required."
  518.         b1=strcat(b1,crlf,b2,crlf,b3)
  519.         execute %a% Message("Information Reset",b1)
  520.         drop(a,b1,b2,b3)
  521.  
  522.        
  523.  _&System Information
  524.         run("cp_info.exe","")
  525.  
  526.  |P&rogram Manager
  527.     errormode(@off)
  528.         terminate(winactivate("Program Manager"),"","") ;Already Running
  529.         errormode(@cancel)
  530.         run("Progman.exe","")
  531.  
  532.  &File Manager
  533.     errormode(@off)
  534.         terminate(winactivate("File Manager"),"","") ;Already Running
  535.         errormode(@cancel)
  536.         run("winfile.exe","")
  537.  
  538.  Print &Manager
  539.     run("printman.exe","")   ; takes care of itself
  540.  
  541.  &Windows Setup
  542.         a=FilePath(Filelocate("system.ini"))
  543.         run(strcat(a,"setup.exe"),"")
  544.         drop(a)
  545.  
  546.  
  547.  _&Edit CmdPost menus
  548.            DirChange(FilePath(FileLocate("CMDPOST.CPM")))
  549.            a=FileItemize("*.CPM")
  550.            a=ItemSelect("Select menu to edit",a," ")
  551.            terminate(a=="","Edit","No file selected")
  552.            ;it it already running???  Find it...
  553.            ErrorMode(@OFF)
  554.            terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  555.            bak=strcat(FileRoot(a),".BAK")
  556.            FileCopy(a,bak,@FALSE)
  557.            run("notepad.exe",a)
  558.            drop(a,bak)
  559.  
  560.  Edit &INI files
  561.        DirChange(FilePath(FileLocate("WIN.INI")))
  562.        NotWin2 = strsub(";",1,(WinVersion(@MAJOR)==2))
  563.        a="WIN.INI"
  564.        execute %NotWin2% a=FileItemize("*.INI")
  565.        execute %NotWin2% a=ItemSelect("Select INI file to edit",a," ")
  566.        execute %NotWin2% terminate(a=="","Edit","No file selected")
  567.        drop(NotWin2,b)
  568.        ;it it already running???  Find it...
  569.        ErrorMode(@OFF)
  570.        terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  571.        bak=strcat( FileRoot(a),".BAK")
  572.        FileCopy(a,bak,@FALSE);
  573.        run("notepad.exe",a)
  574.        drop(a,bak)
  575.  
  576.  Edit System Confi&guration
  577.            run("sysedit.exe","")  ;takes care of itself
  578.  
  579.  PIF Edi&t...
  580.     a=strsub(";",1,IsKeyDown(@SHIFT)==@NO)
  581.     execute %a% l=askline("Notepad Edit","Enter file to edit",CurrentFile())
  582.     execute %a% run("pifedit.exe",l)
  583.     execute %a% exit
  584.     DirChange(FilePath(FileLocate("_default.pif")))
  585.     run("pifedit.exe","")
  586.     drop(a,b)
  587.  
  588.  
  589.  
  590.  
  591.     
  592.